package cn.funeralobjects.aoss.web.mapper;

import cn.funeralobjects.aoss.enums.BucketAction;

import java.beans.PropertyEditorSupport;

/**
 * @author FuneralObjects
 * Create date: 2020/6/8 10:23 AM
 */
public class BucketActionPropertyEditor extends PropertyEditorSupport {
    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        this.setValue(BucketAction.of(Short.valueOf(text)));
    }

    @Override
    public String getAsText() {
        BucketAction action = (BucketAction) this.getValue();
        return String.valueOf(action.getNum());
    }
}
